package com.gopay.common.domain.dps;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import com.gopay.common.domain.BaseEntity;

/**
 * 用户设备信息表
 * 
 * @author lizheng
 *
 */
@Entity
@Table(name = "WA_USER_DEVICE_ACCESS_INFO")
public class UserDeviceAccessInfo extends BaseEntity {
	private static final long serialVersionUID = 1L;

	private String userId;
	private String accessStatus;
	private String accessToken;
	private Integer version;
	private Date createdTs;
	private Date lastUpdTs;
	private String  deviceId;
	private String  deviceType;
	/**
	 * 1-	个人版
	 *	2-	商户版
	 */
	private String appType;
	
	@Id
	@Column(name = "USER_ID", unique = true, nullable = false, length = 10)
	public String getUserId() {
		return this.userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	@Column(name = "ACCESS_STATUS", nullable = false, length = 2)
	public String getAccessStatus() {
		return accessStatus;
	}

	public void setAccessStatus(String accessStatus) {
		this.accessStatus = accessStatus;
	}

	@Column(name = "ACCESS_TOKEN", length = 128)
	public String getAccessToken() {
		return accessToken;
	}

	public void setAccessToken(String accessToken) {
		this.accessToken = accessToken;
	}

	@Version
	@Column(name = "VERSION", nullable = false, precision = 22, scale = 0)
	public Integer getVersion() {
		return this.version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	@Column(name = "CREATED_TS", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	public Date getCreatedTs() {
		return this.createdTs;
	}
	
	
	@Column(name = "DEVICE_ID")
	
	public String getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(String deviceId) {
		this.deviceId = deviceId;
	}
	@Column(name = "DEVICE_TYPE")
	public String getDeviceType() {
		return deviceType;
	}

	public void setDeviceType(String deviceType) {
		this.deviceType = deviceType;
	}

	public void setCreatedTs(Date createdTs) {
		this.createdTs = createdTs;
	}

	@Column(name = "LAST_UPD_TS", nullable = false)
	@Temporal(TemporalType.TIMESTAMP)
	public Date getLastUpdTs() {
		return this.lastUpdTs;
	}

	public void setLastUpdTs(Date lastUpdTs) {
		this.lastUpdTs = lastUpdTs;
	}

	@Column(name = "APP_TYPE", length = 10)
	public String getAppType() {
		return appType;
	}

	public void setAppType(String appType) {
		this.appType = appType;
	}

}
